using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

//TODO 网格可以shader来画
public class GridScript : MonoBehaviour
{

    private List<LineRenderer> _lineRenderers = new List<LineRenderer>();
    // Start is called before the first frame update
    void Start()
    {

    }

    public void initGrid(int row, int col)
    {
        // int count = row * col;
        // //TODO 根据现有的动态增减linerender
        // if (count > _lineRenderers.Count)
        // {
        //     int needNum = count - _lineRenderers.Count;
        //     for (int i = 0; i < needNum; i++)
        //     {
        //          LineRenderer lineRenderer = createNewLineRender();
        //          _lineRenderers.Add(lineRenderer);
        //          lineRenderer.enabled = false;
        //          // gameObject.add
        //     }
        // }
        // else
        // {
        //     
        // }
        // foreach (LineRenderer lineRenderer in _lineRenderers)
        // {
        //     Destroy(lineRenderer);
        // }
        
    }

    private LineRenderer createNewLineRender()
    {
        LineRenderer lineRenderer = new LineRenderer();
        //TODO linerender材质设置等
        return lineRenderer;
    }

    public void showGrid(bool show)
    {
        if (show)
        {
            toShow();
            return;
        }

        toHide();
    }


    private void toShow()
    {
        
    } 
    private void toHide()
    {
        
    }

    // Update is called once per frame
    void Update()
    {

    }
}
